﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
using DatabaseManager.WinForms.Services;
using DevExpress.XtraWaitForm;
using SqlSugar;

namespace DatabaseManager.WinForms
{
    internal static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //// 初始化配置提供者
            //IConfigurationProvider configProvider = new AppSettingsConfigurationProvider();

            //// 初始化连接工厂
            //string connectionString = configProvider.GetSystemConnectionString();
            //IDatabaseConnectionFactory connectionFactory = new DatabaseConnectionFactory(connectionString);

            //// 初始化数据库连接服务
            //var dbConnectionService = new DbConnectionService(configProvider, connectionFactory);

            //// 测试连接
            //if (!dbConnectionService.Connect())
            //{
            //    MessageBox.Show("无法连接到数据库，请检查配置", "连接错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    return;
            //}

            //// 传递连接服务到主窗体
            //Application.Run(new MainForm(dbConnectionService));


            //Application.Run(new MianForm());
            Application.Run(new MainForm2());
        }
    }
}
